{% comment %}
/* Copyright 2009 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
{% endcomment %}
{% extends 'base.html' %}
{% block content %}

{% for post in posts %}
<div class="cc-post">
  <div class="cc-post-head">
    <a
      class="cc-post-title"
      href="/{{post.publish_date|date:"Y/m/d"}}/{{post.path|urlencode}}">
      {{post.title|title}}
    </a>
    <div>
      {% if blog.enable_postinfo %}
        By {{post.author.nickname}}
        On {{post.publish_date|date:"F j, Y"}}
      {% endif %}
      {% if blog.enable_comments %} -
        <a href="/{{post.publish_date|date:"Y/m/d"}}/{{post.path|urlencode}}#comments">Comments ({{post.comment_count}})</a>
      {% endif %}
    </div>
  </div>
  <div class="cc-post-body">
    {% if blog.partial_posts %}
    {{post.body|truncatewords:100}}
    (<a href="/{{post.publish_date|date:"Y/m/d"}}/{{post.path|urlencode}}">
      read more
     </a>)
    {% else %}
    {{post.body}}
  {% endif %}
  </div>
  {% if blog.enable_comments %}
  <div class="cc-post-foot">
    <a href="/{{post.publish_date|date:"Y/m/d"}}/{{post.path|urlencode}}#comments">Comments ({{post.comment_count}})</a>
  </div>
  {% endif %}
</div>
{% if not forloop.last %}
<hr />
{% endif %}
{% endfor %}

{% if older_posts or newer_posts %}
<div>
  {% if older_posts %}
    <a href="/?page={{older_posts}}">older posts &gt;&gt;</a>
  {% endif %}
  {% if newer_posts %}
    <a href="/?page={{newer_posts}}">&lt;&lt; newer posts</a>
  {% endif %}
</div>
{% endif %}


{% endblock %}